const User = require('../schema/user.js').User;


const findalluser=(username)=>{
    return new Promise((resolve,reject)=>{
        User.findOne(username, (err, doc) => {
            if(err){
                reject(err);
            }
            resolve(doc);
        });
    })
}

const updateava=(conditions,update)=>{
    return new Promise((resolve,reject)=>{
        User.update(conditions, update,(err, doc) => {
            if(err){
                reject(err);
            }
            resolve(doc);
        });
    })
}



module.exports={
    findalluser,
    updateava
}